<template>
  <div>
    <el-card style="width: 100%;margin-right: 10px;margin-top: 10px">
      <div>欢迎登录 <span style="color: #409EFF">{{ this.hotelData.name }}</span> 预约管理系统后台</div>
    </el-card>
    <el-card style="width: 100%;margin-right: 10px;margin-top: 10px">
      <div>
<!--        <el-table :data="income" stripe-->
<!--                  :header-cell-style="{backgroundColor:'aliceblue',color:'#666'}" style="border-radius: 10px">-->
<!--          <el-table-column prop="hotel_name" label="酒店名"></el-table-column>-->
<!--          <el-table-column prop="day" label="日期"></el-table-column>-->
<!--          <el-table-column prop="income" label="收入 "></el-table-column>-->
<!--        </el-table>-->
      </div>
    </el-card>
  </div>
</template>

<script>
export default {
  name: "businessHome",
  data() {
    return {
      user: JSON.parse(localStorage.getItem('user') || '{}'),
      dataToKeep: '',
      hotel_id: "",
      hotel: [],
      hotelData: {},
      income:[]
    };
  },
  methods: {
    load_business_id() {
      this.$request.post('/hotel_search/', {
        "business_id": this.user.id,
      }).then(res => {
        if (res.code === '200') {
          this.hotel = res.data.hotel_list;
          const length = this.hotel.length;
          this.hotel_id = this.hotel[length - 1].id;
          this.hotelData = this.hotel[length - 1]
          console.log(this.hotelData)
        } else if (res.code === '501') {
        } else {
          this.$message.error(res.msg)
        }
      })
    },
  },
  created() {
    this.load_business_id()
  }
}
</script>

<style scoped>

</style>